<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>

<script>
    const fp = require('lodash/fp')
    const { Maybe, Container } = require('./support')

    // 1.创建一个函子
    let maybe = Maybe.of([5, 6, 1])

    // 2.实现 ex1 函数

    function ex1(arr) {

    return fp.map((num => fp.add(num, 1)), arr);

    };

    console.log(fp.map((num => fp.add(num, 1)), [1,2,3]))

    // 3.调用测试
    console.log( maybe.map(ex1) ) // Maybe { _value: [ 6, 7, 2 ] }
</script>
</html>